package com.wxf.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;

import java.util.Date;

public class DelayListener implements ChannelAwareMessageListener {

    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println("消息接收时间："+new Date());
        System.out.println("消息内容："+new String(message.getBody(),"utf-8"));
        System.out.println("根据消息信息判断支付状态，进行对应的库存处理");
        channel.basicAck(message.getMessageProperties().getDeliveryTag(),true);
    }
}
